//
//  DSOLinePlot.h
//  Balance
//
//  Created by oracle on 7/19/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CorePlot-CocoaTouch.h"

@interface DSOLinePlot : NSObject <CPTPlotSpaceDelegate,CPTPlotDataSource>

{
@private
    CPTGraph *graph;
    CPTScatterPlot *dsoCurrentPlot;
    CPTScatterPlot *dsoPriorYearPlot;
    CPTScatterPlot *dsoDSOForAllPlot;
    CPTScatterPlot *dsoBestPossiblePlot;
    CPTBarPlot *dsoNoOfCollectorsPlot;
    CPTScatterPlot *rulerPlot;
    CPTXYPlotSpace *barPlotSpace;
    CPTXYAxis *rightY;
    CPTPlotSpaceAnnotation *symbolTextAnnotation;
    
    NSMutableDictionary *dailyDSO;
    NSMutableDictionary *allCustomersDSO;
    NSArray *dailyKeys;
    NSArray *allCustomersKeys;
    NSMutableArray *dailyKeysInRange;
    NSMutableArray *allCustomersKeysInRange;
    NSInteger totalNoOfDataPoints;
    NSInteger noOfDataPointsInRange;
    NSInteger rulerIndex;
    NSString *rulerDateString;
    NSString *selectedDateString;
    
    BOOL rangeChanged;
    BOOL allCustomersPlotAdded;
    BOOL priorPlotAdded;
    BOOL noOfCollectorsPlotAdded;
    BOOL bestPossibleDSOPlotAdded;
    BOOL rulerEnabled;
    
    NSString *initStartDateString;
    NSDate *initStartDate;
    NSMutableArray *animationStartDailyKeys;
    NSMutableArray *animationUnit;
    NSUInteger timerCount;
    NSTimer *dataTimer;
}


- (id) initWithOneCustomerData:(NSMutableDictionary *) dsoData allCustomersData:(NSMutableDictionary *) allCustomersDSOData;
- (void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme;
- (void)removePlot:(NSString *)plotIdentifier;
- (void)removeRulerAnnotation;
- (void)addPlot:(NSString *)plotIdentifier;
- (void)applyRulerPlotColor;
- (void)highlightRulerPlotColor;
- (void)displayRulerAnnotation;
- (void)prepareAnimationData;


-(void)respondToRangeChangeFromDate:(NSString *)newFromDateString toDate:(NSString *)newToDateString;

@end
